package com.fitso.model.dao.hibernate.type.nutrient;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.hibernate.HibernateException;
import org.hibernate.usertype.UserType;

import com.fitso.model.bean.nutrition.Nutrient;

/**
 * Conversion utility to/from the database/java type of {@link Nutrient} types
 * 
 * @author timothystorm
 * 
 */
public abstract class NutrientHibernateType implements UserType {

	public Object assemble(Serializable cached, Object owner) throws HibernateException {
		return null;
	}

	public Object deepCopy(Object value) throws HibernateException {
		return null;
	}

	public Serializable disassemble(Object value) throws HibernateException {
		return null;
	}

	public boolean equals(Object o1, Object o2) throws HibernateException {
		return new EqualsBuilder().append(o1, o2).isEquals();
	}

	public int hashCode(Object o) throws HibernateException {
		return new HashCodeBuilder().append(o).toHashCode();
	}

	public boolean isMutable() {
		return true;
	}
}
